package com.ihealthway.all.groupbuy.modules.admin;

import com.ihealthway.all.groupbuy.services.AdminLogService;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.POST;
import org.nutz.mvc.annotation.Param;

import java.util.Map;

/**
 * System admin operate log class
 * @author 凡梦星尘(elkan1788@gmail.com)
 */
@IocBean
@At("/admin/log")
public class AdminLogModule {

    private static final Log logger = Logs.get();

    @Inject
    private AdminLogService adminLogService;

    @At
    @Ok("beetl:admin/adminlog.jsp")
    public void index() {

    }

    @POST
    @At
    public Map<String,Object> dataList(int page, int rows, @Param("module") String module,
                                       @Param("type") String type,
                                       @Param("content") String content,
                                       @Param("start") String startD,
                                       @Param("end") String endD) {

        Map<String, Object> map = adminLogService.getAdminLogData(page, rows, module, type, content, startD, endD);

        return map;
    }
}
